<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <component :is="com"></component>
    </div>
</body>
<script src="./vue.global.js"></script>
<script>

    //定义一个组件A
    const comA  = {
        template:`
            <div>
                <h3>怒号</h3>
            </div>
        
        `
    }
       //定义一个组件B
       const comB  = {
        template:`
            <div>
                <h3>你好</h3>
            </div>
        
        `
    }


    const app = Vue.createApp({
        data(){
            return{
                com: comB
            }
        }
    })
    app.mount("#app")
</script>
</html>